
3
3
.
.
1
1
D
D
a
a
t
t
a
a
T
T
y
y
p
p
e
e
s
s
Decimal: 65 Hexadecimal: 0x41 Binary: 0b100_0001
Decimal: 65L Hexadecimal: 0x41l Binary: 0b100_0001L
Basic: 65.2F Scientific: 0.652E2f
Basic: 65.2 Scientific: 0.652E2
Kotlin doesn't support Array Literal or Data Type. Instead function arrayOf<T> is used to create it and Array<T> to store it.
Scalar Data Types
var value : Boolean = true
var value : Float = 65.2F
var value : Double = 65.2
var value : String = "Hello ${name} \n"
Class for storing constant strings.
var value : Array<Int> = arrayOf<Int>(1, 2, 3, 4, 5)
Class for storing Objects.
Data Types & Literals
//GENERAL
var value1 : Int? = null //Null Literal
var value2 : Boolean = true //Boolean Literal: true, false
var value3 : Char = 'A' //Character Literal (16-bit)
//NUMBERS
var value4 : Byte = 65
var value5 : Short = 65
var value6 : Int = 65 //Integer Literal: 0x41 0b100_0001
var value7 : Long = 65L //Long Literal: 0x41L 0b100_0001L
var value8 : Float = 65.2F //Float Literal: 0.652E2F
var value9 : Double = 65.2 //Double Literal: 0.652E2
//COLLECTIONS
var value10 : String = "Hello ${name} \n" //Collection of characters
var value11 : Array<Int> = arrayOf(1, 2, 3, 4, 5) //Generic Class